import java.text.SimpleDateFormat

class GenUtil {

	public static String procDate(String dateStr,String pattern)
	
	{
	 
	SimpleDateFormat oldFormatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.ENGLISH);
	oldFormatter.setTimeZone(TimeZone.getTimeZone("GMT"));
	def newDate= oldFormatter.parse(dateStr);
	return formatDate(newDate,pattern)
	}
	
	public static String formatDate(Date date,String pattern)
	
	{
		SimpleDateFormat newFormatter = new SimpleDateFormat(pattern);
		return newFormatter.format(date);
	}

}